package com.greenhouse9.prog06;

import java.math.BigDecimal;

public class Calc1 {
    public static void main(String[] args){
        System.out.println("���Z�̌��ʂ�" + (3+2)+ "�ł��B");
        System.out.println("���Z�̌��ʂ�" + (3-2) + "�ł��B");
        //
        int x;
        x = 4;
        System.out.println(2*x + 3);
        double a = 14.0;
        double b = 15.0;
        System.out.println((a + b) /2);
        double c = calc1( 1, 11, 1d);
        System.out.println("c= " + c);

        BigDecimal bx = new BigDecimal(1d);
        BigDecimal by = new BigDecimal(3);
        System.out.println(bx.scale());
        System.out.println(bx.toString());
        System.out.println(bx.divide(by, 200, BigDecimal.ROUND_DOWN));

    }

    public static double calc1 (int n, int m, double x){
        double value = 0;

        if ( m==0 ){
            return ( 1.0d + x/n );
        }
        else {
            System.out.println( 1.0 + (x / n) );
            return ( 1.0d + ((x/n)*calc1( n + 1, m-1 ,x)));
        }

    }
}